<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="/js/chosen/chosen.css" />
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <label for="code_product"></label>
  <table width="900" border="1" cellspacing="0" cellpadding="10">
    <tr>
      <th scope="col" width="150">Today is</th>
      <th colspan="4" scope="col"><?php echo 	Model_DatetimeHelper::dateToday();?></th>
    </tr>
    <tr>
      <td>Barcode</td>
      <td colspan="4"><input name="code_product" type="text" id="code_product" value="<?php echo $this->codeProduct?>" />
      <input name="des_product" type="hidden" id="des_product" value="<?php echo $this->desProduct?>" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>Qty</td>
      <td>Box No</td>
      <td rowspan="6">&nbsp;</td>
      <td rowspan="6">&nbsp;</td>
    </tr>
    <tr>
      <td>First</td>
      <td><input type="text" name="qty" id="qty" /></td>
      <td><input type="text" name="box_no" id="box_no" /></td>
    </tr>
    <tr>
      <td>Second</td>
      <td><input type="text" name="qty2" id="qty2" /></td>
      <td><input type="text" name="box_no2" id="box_no2" /></td>
    </tr>
    <tr>
      <td>Thrid</td>
      <td><input type="text" name="qty3" id="qty3" /></td>
      <td><input type="text" name="box_no3" id="box_no3" /></td>
    </tr>
    <tr>
      <td>Fourth</td>
      <td><input type="text" name="qty4" id="qty4" /></td>
      <td><input type="text" name="box_no4" id="box_no4" /></td>
    </tr>
    <tr>
      <td>Fifth</td>
      <td><input type="text" name="qty5" id="qty5" /></td>
      <td><input type="text" name="box_no5" id="box_no5" /></td>
    </tr>
    <tr>
      <td colspan="5">&nbsp;</td>
    </tr>
    <tr>
      <td>Supplier</td>
      <td colspan="2"><label for="id_supplier"></label>
        <select name="id_supplier" id="id_supplier"  data-placeholder="Select Supplier" class="chzn-select" >
        <?php foreach($this->chinaSpList as $k => $v){?>
          <option value="<?php echo $v['id_supplier']?>"><?php echo $v['title_supplier']?></option>
        <?php }?> 
      </select></td>
      <td>History</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="5" align="center"><input type="submit" name="btn_save" id="btn_save" value="SAVE IT" /></td>
    </tr>
  </table>
  <br />
  <br />
<br />
</form>
<h1>
<?php 

if(isset($_POST['btn_save'])){
	echo "SCANNED:".$_POST['code_product']." BOX NO :".$_POST['box_no']." ".$_POST['qty']." pcs ";
	if($_POST['box_no2']!="" && $_POST['qty2']!="" ){
	echo " BOX NO :".$_POST['box_no2']." ".$_POST['qty2']." pcs "; 	
		}
	if($_POST['box_no3']!="" && $_POST['qty3']!="" ){
	echo " BOX NO :".$_POST['box_no3']." ".$_POST['qty3']." pcs "; 	
		}
	if($_POST['box_no4']!="" && $_POST['qty4']!="" ){
	echo " BOX NO :".$_POST['box_no4']." ".$_POST['qty4']." pcs "; 	
		}
	if($_POST['box_no5']!="" && $_POST['qty5']!="" ){
	echo " BOX NO :".$_POST['box_no5']." ".$_POST['qty5']." pcs "; 	
		}			
	
	echo "<a href=\"/order/start-scan\" target=\"_blank\">Scan Another One</a>";
	
	}
?>
</h1>
</body>

<script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
  <script src="/js/chosen/chosen.jquery.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    var config = {
      '.chzn-select': {allow_single_deselect:true},
    }
    for (var selector in config) {
      $(selector).chosen(config[selector]);
    };
  </script>
</html>
